comp.lang.c
[Top] [All Lists]

[Makefile]How can I deal with multi-dirs?

Subject: [Makefile]How can I deal with multi-dirs?
From: "M.Liang Liu"
Date: Tue, 1 Apr 2008 01:05:38 -0700 PDT
Newsgroups: comp.lang.c

I have a project with the following dirs:
---------------------------------------------------------------------------------------
+src
  |-proj0
     |-program1
     |-program2
  |-proj1
     |-program1
     |-program2
     |-program3
     |-program4
  |-proj3
     |-program1
     |-program2
     |-program3
   ....
  |-proj9
-Makefile
+include
-README
+lib
  |-lib1
  |-lib2
---------------------------------------------------------------------------------------
There are 10 project-dirs here in src, named proj0-proj9. Each project
has several program_dirs which containing some .c files
All .h files are under include in the top dir, the same as src.

I would like to write a makefile, which can help me compile all the .c
files and generate an executable file for each *program*.  Considering
there are several independent programs in each project, the work
should be done within a single makefile at the top dir.

How can I deal all the programs under each project in a single top-
level makefile?

Thanks!

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy